package com.cardone.platform.common.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.platform.common.dto.OperateLogDto;

/**
 * 操作日志服务
 *
 * @author yaohaitao
 */
public interface OperateLogService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.common.service.OperateLogService";

	/**
	 * 保存:操作日志
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param saveOperateLog
	 *            操作日志对象
	 * 
	 * @return 操作日志对象
	 */
	@Deprecated
	@CacheEvict(value = OperateLogService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, OperateLogDto saveOperateLog);

	/**
	 * 保存:操作日志
	 * 
	 * @param saveOperateLog
	 *            操作日志对象
	 * 
	 * @return 操作日志对象
	 */
	@Deprecated
	@CacheEvict(value = OperateLogService.BEAN_ID, allEntries = true)
	OperateLogDto saveByIdOrCode(OperateLogDto saveOperateLog);

	/**
	 * 插入
	 * 
	 * @param insertOperateLog
	 *            操作日志对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = OperateLogService.BEAN_ID, allEntries = true)
	int insertByCode(OperateLogDto insertOperateLog);
	
	/**
	 * 删除
	 * 
	 * @param deleteOperateLog
	 *            操作日志对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = OperateLogService.BEAN_ID, allEntries = true)
	int deleteByIds(OperateLogDto deleteOperateLog);

	/**
	 * 更新
	 * 
	 * @param updateOperateLog
	 *            操作日志对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = OperateLogService.BEAN_ID, allEntries = true)
	int updateByCode(OperateLogDto updateOperateLog);

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param readOperateLog
	 *            操作日志对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = OperateLogService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(OperateLogDto readOperateLog);
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findOperateLog
	 *            操作日志对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = OperateLogService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, OperateLogDto findOperateLog);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findOperateLog
	 *            操作日志对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = OperateLogService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, OperateLogDto findOperateLog);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findListOperateLog
	 *            操作日志对象
	 * 
	 * @return 操作日志对象集合
	 */
	@Deprecated
	@Cacheable(value = OperateLogService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, OperateLogDto findListOperateLog);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return 操作日志对象集合
	 */
	@Deprecated
	@Cacheable(value = OperateLogService.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param paginationOperateLog
	 *            操作日志对象
	 * 
	 * @return 操作日志分页对象
	 */
	@Deprecated
	@Cacheable(value = OperateLogService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, OperateLogDto paginationOperateLog);
}